import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/task/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 详情
export const detail = (id) => {
  return request({
    url: '/api/hg-equipment/task/info',
    method: 'get',
    params: {
      id
    }
  })
}

// 完成保养任务
export const finish = (id) => {
  return request({
    url: '/api/hg-equipment/task/finish',
    method: 'get',
    params: {
      id
    }
  })
}

// 接单
export const receive = (ids) => {
  return request({
    url: '/api/hg-equipment/task/receive',
    method: 'get',
    params: {
      ids
    }
  })
}
// 拉取备件/物料待使用列表
export const useList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/task/useList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 填报保养结果
export const update = (data,ids) => {
  return request({
    url: '/api/hg-equipment/task/update',
    method: 'post',
    data: data,
    params: {
      ids
    }
  })
}

// 指标统计
export const select = () => {
  return request({
    url: '/api/hg-equipment/task/select',
    method: 'get',
  })
}


